<template>
	<view class="all">
		<view class="top">
			<view class="top_box">
				<view class="top_box_title"> {{data_list.address_name}} <text style="margin-left: 20upx;">{{data_list.address_phone}}</text> </view>
				<view class="top_box_titles">{{data_list.address}}</view>
			</view>
		</view>
		<view class="cp_xinxi">
			<view class="cp_xinxi_title">产品</view>
			<view class="cp_xinxi_box">
				<image :src="data_goods.image" mode="aspectFill" class="box_img"></image>
				<view class="box_text">
					<view class="box_text_title" style="height: 100upx;">{{data_goods.name}}</view>
					<view class="box_text_titles"></view>
					<view class="box_text_titles" style="margin-top: 10upx;">数量：{{data_list.number}}</view>
					<view class="box_text_title" style="margin-top: 20upx;">¥{{data_goods.price}}</view>
				</view>
			</view>
		</view>
		<view class="cp_xinxi">
			<view class="cp_xinxi_title" style="font-weight: bold;">付款信息</view>
			<view class="cp_xinxi_title" style="padding: 20upx 0;">商品总额 <text style="color: aqua;margin-left: 20upx;">{{data_list.money}}</text> 元 </view>
			<view class="cp_xinxi_title" style="padding: 20upx 0;">实际付款 <text style="color: #ff0000;margin-left: 20upx;">{{data_list.money}}</text> 元 </view>
			<view class="cp_xinxi_title" style="padding: 20upx 0;">付款时间 <text style="color: #333; font-size: 26upx;margin-left: 20upx;">{{data_list.addtime}}</text>  </view>
		</view>
		<view class="cp_xinxi">
			<view class="cp_xinxi_title" style="font-weight: bold;">订单信息</view>
			<view class="cp_xinxi_title" style="padding: 20upx 0;" @click="setClipboardData(data_list.order_no)">订单编号 <text style="font-size: 26upx;font-weight: 400;margin-left: 20upx;">{{data_list.order_no}}</text> <text style="color: blue;"> （复制） </text> </view>
			<view v-if="data_goods.virtual == 2" class="cp_xinxi_title" style="padding: 20upx 0;" @click="setClipboardData(data_goods.link)">下载链接 <text style="font-size: 26upx;font-weight: 400;margin-left: 20upx;">{{link}}</text> <text style="color: blue;"> （复制） </text> </view>
			<!-- <view class="cp_xinxi_title" style="padding: 20upx 0;">下单时间 <text style="color: #333; font-size: 26upx;margin-left: 20upx;">{{data_list.addtime}}</text>  </view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				order_id:'',
				data_list:{},
				data_goods:{}
			}
		},
		onLoad(num) {
			this.order_id = num.order_id
			this.order_detail_api()
		},
		methods: {
			order_detail_api(num) {
				var that = this
				that.$request(that.$Api.order_detail_api, {
					access_token:uni.getStorageSync('access_token'),
					order_id:that.order_id,
				},"POST").then(res => {
					if( res.data.code == 0 ){
						that.data_list = res.data.data.list
						that.data_goods = res.data.data.goods
					}else{
						uni.showToast({
							title: res.data.msg,
							duration: 2000,
							icon: 'none'
						});
					}
				})
			},
			setClipboardData(data) {
				uni.setClipboardData({
					data: data,
					success: function () {
						console.log('success');
					}
				});

			},
		}
	}
</script>

<style lang="less">
	page{
		.all{
			.cp_xinxi{
				.cp_xinxi_box{
					.box_text{
						.box_text_titles{
							font-size: 26upx;
							font-weight: 300upx;
							margin-top: 10upx;
						}
						.box_text_title{
							font-size: 30upx;
							font-weight: 500upx;
						}
						margin-left: 10upx;
						margin-top: 10upx;
					}
					.box_img{
						width: 200upx;
						height: 200upx;
					}
					display: flex;
					padding: 20upx 0;
				}
				.cp_xinxi_title{
					font-size: 32upx;
					font-weight: 500;
					color: #333;
					padding-bottom: 20upx;
					border-bottom: 1upx solid #eee;
				}
				padding: 20upx 25upx;
			}
			.top{
				.top_box{
					.top_box_titles{
						font-size: 26upx;
						font-weight: 400;
						color: #666;
						margin-top: 10upx;
					}
					.top_box_title{
						display: flex;
						font-size: 32upx;
						font-weight: bold;
						color: #333;
					}
					// display: flex;
					padding: 20upx 25upx;
					border-bottom: 1upx solid #eee;
				}
			}
		}
	}
</style>
